package com.sky.controller.admin;

import com.sky.result.Result;
import com.sky.service.WorkspaceService;
import com.sky.vo.BusinessDataVO;
import com.sky.vo.DishOverViewVO;
import com.sky.vo.OrderOverViewVO;
import com.sky.vo.SetmealOverViewVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "工作台接口")
@RestController
@RequestMapping("/admin/workspace")
public class WorkspaceController {

    @Autowired
    private WorkspaceService workspaceService;


    /**
     * 今日数据
     * */
    @ApiOperation("今日数据")
    @GetMapping("/businessData")
    public Result<BusinessDataVO> businessData(){
        BusinessDataVO vo = workspaceService.businessDate();
        return Result.success(vo);
    }

    /**
     * 订单总览
     * */
    @ApiOperation("订单管理")
    @GetMapping("/overviewOrders")
    public Result<OrderOverViewVO> orderOverView(){
        OrderOverViewVO vo = workspaceService.orderOverView();
        return Result.success(vo);
    }

    /**
     * 菜品总览
     * */
    @ApiOperation("菜品总览")
    @GetMapping("/overviewDishes")
    public Result<DishOverViewVO> overviewDishes(){
        DishOverViewVO vo = workspaceService.overviewDishes();
        return Result.success(vo);
    }

    /**
     * 套餐总览
     * */
    @ApiOperation("套餐总览")
    @GetMapping("/overviewSetmeals")
    public Result<SetmealOverViewVO> overviewSetmeals(){
        SetmealOverViewVO vo = workspaceService.overviewSetmeals();
        return Result.success(vo);
    }



}
